package licode.unisop.log.client.feign;

import licode.unisop.log.client.dto.AuditLogDTO;
import licode.unisop.log.client.dto.CallingLogDTO;
import licode.unisop.log.client.dto.LoginLogDTO;
import licode.unisop.log.client.req.AuditLogIn;
import licode.unisop.log.client.req.CallingLogIn;
import licode.unisop.log.client.req.LoginLogIn;
import licode.unisop.types.AuthConst;
import licode.unisop.unilite.dp.PageData;
import licode.unisop.unilite.result.UniResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 日志查询
 *
 * @author licode
 */
@FeignClient(name = "${uni-sop.log.service:uni-log-service}", url = "${uni-sop.log.host:}")
public interface LogQueryFeign {
    @PostMapping("/auth-log/api/v1/query/audit/list/{platformId}")
    UniResult<PageData<AuditLogDTO>> auditList(
            @RequestParam(AuthConst.PLATFORM_TOKEN) String platformId,
            @RequestBody AuditLogIn req);

    @PostMapping("/auth-log/api/v1/query/call-api/list/{platformId}")
    UniResult<PageData<CallingLogDTO>> callApiList(
            @RequestParam(AuthConst.PLATFORM_TOKEN) String platformId,
            @RequestBody CallingLogIn req);

    @PostMapping("/auth-log/api/v1/query/login/list/{platformId}")
    UniResult<PageData<LoginLogDTO>> loginList(
            @RequestParam(AuthConst.PLATFORM_TOKEN) String platformId,
            @RequestBody LoginLogIn req);
}
